package com.fametal.ui.activity;

import android.app.Activity;
import android.app.ActivityGroup;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;

import com.fametal.R;
import com.fametal.ui.utils.Utils;

public class SystemSettingsActivity extends Activity implements OnClickListener {

	private ActivityGroup mGroup;
	private LinearLayout container;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		mGroup = (ActivityGroup)getParent();
		container = (LinearLayout) mGroup.getWindow().findViewById(R.id.signal_container);
		
		View contentView = LayoutInflater.from(getParent()).inflate(R.layout.system_settings, null);
		setContentView(contentView);
		Button video_metting_model_set = (Button) contentView.findViewById(R.id.video_metting_model_set);
		video_metting_model_set.setText(Html.fromHtml(getResources().getString(R.string.video_conference_model_set)));
		video_metting_model_set.setOnClickListener(this);
		
		Button video_remote_control = (Button) contentView.findViewById(R.id.video_remote_control);
		video_remote_control.setText(Html.fromHtml(getResources().getString(R.string.video_meeting_remote_control_settings)));
		video_remote_control.setOnClickListener(this);
		
		Button goBack = (Button) contentView.findViewById(R.id.settins_back);
		goBack.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.settins_back:
			mGroup.getLocalActivityManager().removeAllActivities();
			Utils.setActivityContent(mGroup, "signal", container, SignalSwitchActivity.class);
			break;
		case R.id.video_metting_model_set:
			mGroup.getLocalActivityManager().removeAllActivities();
			Utils.setActivityContent(mGroup, "signal", container, VideoModeSettingsActivity.class);
			break;
		}
	}
	
}
